<template>
    <el-table :data="newOrdersStore.orderPlans" style="width: 100%">
        <el-table-column property="pa" label="采收计划批次" />
        <el-table-column property="pb" label="计划采收时间" />
        <el-table-column property="pc" label="计划采收地块" />
        <el-table-column property="pd" label="采收作物" />
        <el-table-column property="pe" label="计划采收量" />
        <el-table-column property="realname" label="计划执行人" />
        <el-table-column label="操作">
            <template #default="{ row }">
                <el-row gutter="20">
                    <el-col :span="12">
                        <el-button size="small" style="width: 60px;" @click="emits('buy',row)">去采收</el-button>
                    </el-col>
                    <el-col :span="12">
                        <el-button size="small" style="width: 60px;" @click="emits('check',row)">查看</el-button>
                    </el-col>
                </el-row>
                <el-row gutter="20" style="margin-top: 10px;">
                    <el-col :span="12">
                        <el-button size="small" style="width: 60px;" @click="emits('edit', row)">编辑</el-button>
                    </el-col>
                    <el-col :span="12">
                        <el-button size="small"  style="width: 60px;"
                            @click="handleRemove(row.id)">删除</el-button>
                    </el-col>
                </el-row>
            </template>
        </el-table-column>
    </el-table>
</template>

<script lang='ts' setup>
import { watch } from 'vue';
import { useNewOrdersStore } from '@/stores/NewOrdersStore';

import type { IOderPlans } from '@/stores/NewOrdersStore';
const newOrdersStore = useNewOrdersStore();
// import router from '@/router'
// import RouterMap from '@/router/RouterMap';
// import { RouterView } from 'vue-router';

watch( () => newOrdersStore.orderPlans , (newVal: IOderPlans[]) => {
  newOrdersStore.orderPlans = newVal;
  console.log(489798465498498)
},);
const emits = defineEmits(['remove', 'edit','check','buy'])
const handleRemove = (pa: number) => {
    emits('remove', pa)
}
// const Edit = () => {
   
//     router.push('edit');
// }
const tc = () => {
    alert('功能开发中')
}
</script>

<style lang='scss' scoped>
.el-button{
    background-color: #1E4D58 !important;
    color: #4BC6C7;
    border: 0;
}
::v-deep(.el-table__body .el-table__row .el-table__cell) {
  background-color: #0F2634!important;
  border: 0;
  color: white;
    border-bottom: none !important;
}
::v-deep(.el-table__header .el-table__cell) {
  background-color: #1D4A56 !important;
  border: 0;
  color: white;
  border-bottom: none !important;
}
::v-deep(div.el-table__inner-wrapper::before) {
  display: none !important;
  border: none !important;
  height: 0 !important;
  background: none !important;
}

</style>